package com.jlpay.openapi.demo.trans.refunds;

import com.jlpay.open.jlpay.sdk.java.model.trans.refunds.request.RefundsQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.trans.refunds.response.RefundsResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author zhangyongfeng
 * @date 2025/3/18
 */
public class RefundsQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(RefundsQueryService.class);

    public static void main(String[] args) {
        RefundsQueryRequest request = buildRequest();
        RefundsResponse response = JlpayOpenApiService.openMerchService()
                .get(request, RefundsResponse.class);
        LOGGER.info("退款申请查询响应:{}", JsonUtils.toString(response));
    }

    private static RefundsQueryRequest buildRequest() {
        RefundsQueryRequest request = new RefundsQueryRequest();
        request.setMchId("849581183510017");
        request.setOutTradeNo("202503185000052Test");
        return request;
    }
}
